#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int exchangeBits(int num) {
        int sum = 0;
        for (int i = 0; i < 30; i += 2)
        {
            bool right = num & (1 << i);
            bool left = num & (1 << (i + 1));
            cout << right << " " << left << endl;
            sum += left * pow(2, i);
            sum += right * pow(2, i + 1);
        }

        return sum;
    }
};